#include <stdlib.h>
#include <stdio.h>
#include <SDL/SDL.h>
#include <SDL/SDL_ttf.h>
#include <SDL/SDL_image.h> /* Inclusion du header de SDL_image (adapter le dossier au besoin)
execution : gcc main.c -lSDL -lSDL_image -lSDL_mixer -o game*/
 
void pause();
 
int main(int argc, char *argv[])
{
int continuer = 1, i;
SDL_Event event;
TTF_Init();

TTF_Font *police = NULL;
/*CHargrement De La POLICE*/
police = TTF_OpenFont("police/Walker on the Moon.ttf", 40);'


 Écriture du texte 
sprintf(t, "Score : %d", score);
texte = TTF_RenderText_Blended(police, t, 0,0,0);
 
    SDL_Surface *ecran = NULL, *imageDeFond = NULL ,  *bal = NULL; 
    SDL_Rect positionFond;
 	
	SDL_Rect positionbal;
 	SDL_Init(SDL_INIT_VIDEO);
    positionFond.x = 0;
    positionFond.y = 0;
	positionbal.x = 100;
	positionbal.y = 100;

  
    ecran = SDL_SetVideoMode(800, 600, 32, SDL_HWSURFACE);
    SDL_WM_SetCaption("Street basket", NULL);
 
    imageDeFond = IMG_Load("bg.jpg");

  bal=IMG_Load("ball.png");
 SDL_Flip(ecran);
  
  
    while (continuer)
    {

        SDL_WaitEvent(&event);
        switch(event.type)
        {
            case SDL_QUIT:

                continuer = 0;
        }

 
 SDL_BlitSurface(imageDeFond, NULL, ecran, &positionFond);
SDL_BlitSurface(bal, NULL, ecran, &positionbal);
SDL_Delay(70);
    SDL_Flip(ecran);
/* Écriture du texte*/ 
score++;
sprintf(t, "Score : %d", score);
texte = TTF_RenderText_Blended(police, t, 0,0,0);
 
    
}
 
    SDL_FreeSurface(imageDeFond);

	SDL_FreeSurface(bal);
    SDL_Quit();
 
    return EXIT_SUCCESS;
}
